package org.corey.wyp.command
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	import mx.controls.Alert;
	import mx.rpc.IResponder;
	
	import org.corey.wyp.business.PropertyManagerDelegate;
	import org.corey.wyp.model.ProperityModelLocator;
	import org.corey.wyp.vo.Calendar;
	
	public class ApplicationInitCommand implements ICommand,IResponder 
	{
		public function ApplicationInitCommand()
		{
		}
		
		public function execute(event:CairngormEvent):void{
			var pm:PropertyManagerDelegate=new PropertyManagerDelegate(this);
			pm.getServerTime();
		}
		
		public function result(event:Object):void{
			var c:Calendar=event.result as Calendar
			ProperityModelLocator.getInstance().application.today=c;
		}
		
		public function fault(info:Object):void{
			Alert.show("fault:"+info.toString());
		}

	}
}